/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2021/10/12
 * Time: 9:13
 * Description:
 */
public class TestDemo {

    public static void main(String[] args) {
        String a = "hello";
        switch (a) {
            case "hello":
                System.out.println("1");
                //break;
            case "abc":
                System.out.println("2");
                //break;
            default:
                System.out.println("输入错误");
                //break;
        }
    }

    public static void main27(String[] args) {
        int x = 20;
        int y = 10;
        if (x == 10) {
            if (y == 10) {
                System.out.println("aaa");
            } else {
                System.out.println("bbb");
            }
        }
    }

    public static void main26(String[] args) {
        int year = 2005;
        if(year%100!=0 && year%4==0 || year % 400 == 0) {
            System.out.println("是闰年！");
        }else{
            System.out.println("不是闰年！");
        }
    }

    public static void main25(String[] args) {
        int year = 2021;
        if(year % 100 == 0) {
            if(year % 400 == 0) {
                System.out.println("是闰年！");
            }else{
                System.out.println("不是闰年！");
            }
        }else{
            if(year % 4 == 0) {
                System.out.println("是闰年！");
            }else {
                System.out.println("不是闰年！");
            }
        }
    }

    public static void main24(String[] args) {
        int num = 10;
        if(num > 0) {
            System.out.println("正数");
        }else if(num == 0) {
            System.out.println("等于0的数字");
        }else {
            System.out.println("负数");
        }
    }


    public static void main23(String[] args) {
        int n = 10;
        if(n % 2 == 0) {
            System.out.println("偶数");
        }else {
            System.out.println("奇数");
        }
    }

    public static void main22(String[] args) {
        System.out.println("aaa");
        System.out.println("ccc");
        System.out.println("bbb");
    }

    public static void main21(String[] args) {
        int a = 10;
        int b = 20;
        int tmp = 0;
        tmp = a;
        a = b;
        b = tmp;

    }

    /**
     *
     * @param args
     */
    public static void main20(String[] args) {//psvm
        System.out.println((10 < 20) && (20 < 30));//sout
        System.out.println((1+2)*3);

        //System.out.println(10 > 20 & 10 / 0 == 0);
        //System.out.println(10 < 20 | 10 / 0 == 0);
        int a = 10;
        int b = 20;
        int max = a > b ? a : b;
        System.out.println(max);
    }

    public static void main19(String[] args) {
        int a = 110;
        int b = 20;
        System.out.println(!(a < b));

        int c = 30;
        System.out.println(a < b || b < c);
    }

    public static void main18(String[] args) {
        int a = 1;
        int b = 2;
        System.out.println(a == b);//false
        System.out.println(a != b);//true
        System.out.println(a > b);//false
        System.out.println(a < b);//true
        System.out.println(a >= b);//大于或者等于  //false
        System.out.println(a <= b);//true
    }

    public static void main17(String[] args) {
        int a = 10;
        int b = ++a;//后置++
        System.out.println(b);
        System.out.println(a);
    }

    public static void main16(String[] args) {
        int a = 10;
        ++a;//后置++
        System.out.println(a);
    }

    public static void main15(String[] args) {
        short s = 1;
        //s = s+1;
        s += 1;//帮你进行强制类型转换
        System.out.println(s);
    }

    public static void main14(String[] args) {
        int a = 10;
        //a = a+1;//
        a += 1;
        System.out.println(a);
    }

    public static void main13(String[] args) {
        System.out.println(10%3);//1
        //System.out.println(11.5%2.0);//1.5
        System.out.println(-10%3);//
        System.out.println(10%-3);//
        System.out.println(-10%-3);//

    }

    public static void main12(String[] args) {
        int a = 10;
        int b = 0;
        System.out.println(a/b);
    }

    public static void main11(String[] args) {
        String s = "10";
        int num = Integer.valueOf(s);
        System.out.println(num);
        //int a;
        //System.out.println(a);
    }

    public static void main10(String[] args) {
        int num = 10;
        String str1 = num+"";
        System.out.println(str1);
        String str2 = String.valueOf(num);
        System.out.println(str2);
    }

    public static void main9(String[] args) {
        byte a = 1;
        byte b = 2;
        byte c = (byte)(a+b);//
        System.out.println(c);

        byte d = 1+2;//byte d = 3;
        System.out.println(d);


    }

    public static void main8(String[] args) {
        int a = 10;
        long b = 20;
        int c = (int)(a+b);
    }


    public static void main7(String[] args) {
        /*int a = 1;
        boolean b = (boolean) a;

        boolean c = true;
        int d = (int)c;*/
        byte b = 10;//-128 127

    }

    public static void main6(String[] args) {
        int a = 10;//4
        //long b = a;
        long l = 11;
        a = (int)l;

        double d = a;
        int c = (int)d;

        float f = a;
        int c2 = (int)f;


    }

    public static void main5(String[] args) {
        final int A = 10;
        //a = 9;//error
        System.out.println(A);
        final int B;
        B = 10;
        //B = 9;
        System.out.println(B);
    }

    //int g = 10;

    public static void main4(String[] args) {
        int p = 10;

        int a = 2;
        {
            a = 1;
        }
        System.out.println(a);//1
    }


    public static void main3(String[] args) {

        //System.out.println(p);

        int a = 10;
        int b = 20;
        //a = 10,b = 20
        System.out.println("a = "+a+", b = "+b);
        System.out.println("a+b = "+a+b);
        System.out.println("a+b = "+(a+b));
        System.out.println(10+""+20+"ab"+"cd");
        System.out.println("10"+20+"ab"+"cd");
    }

    public static void main2(String[] args) {
        String str1 = "ab";
        String str2 = "cd";
        System.out.println(str1+str2);
        String ret = 10+str1+str2;
        System.out.println(ret);
        ret = str1+str2+10+20;
        System.out.println(str1+str2+10+20);
        ret = 10+20+str1+str2;
        System.out.println(10+20+str1+str2);
    }


    public static void main1(String[] args) {
        String str = "\'abcdef\'";//"abcdef"
        System.out.println(str);
        String str2 = "\\\\abcdef\\\\";//\abcdef\
        System.out.println(str2);
    }
}
